{% extends 'base.html' %}

{% block title %}首页 - 外卖管理系统{% endblock %}

{% block content %}
<h1 class="mb-4">餐厅列表</h1>

<div class="row">
    {% for restaurant in restaurants %}
    <div class="col-md-4 mb-4">
        <div class="card">
            <div class="card-body">
                <h5 class="card-title">{{ restaurant.name }}</h5>
                <p class="card-text">{{ restaurant.address }}</p>
                <p class="card-text"><small class="text-muted">电话：{{ restaurant.phone }}</small></p>
                <a href="{% url 'restaurant_detail' restaurant.id %}" class="btn btn-primary">查看菜单</a>
            </div>
        </div>
    </div>
    {% empty %}
    <div class="col">
        <p>暂无餐厅信息</p>
    </div>
    {% endfor %}
</div>
{% endblock %}